package com.mti.app
{
	import com.mti.app.controller.ApplicationStartupCommand;
	import com.mti.app.controller.LoadChoiceCommand;
	import com.mti.app.controller.LoadEvenementCommand;
	import com.mti.app.controller.LoadInfosQRCodeCommand;
	import com.mti.app.controller.LoadMenuCommand;
	import com.mti.app.controller.LoadQRCodeCommand;
	
	import org.puremvc.as3.interfaces.IFacade;
	import org.puremvc.as3.patterns.facade.Facade;
	
	
	public class ApplicationFacade extends Facade implements IFacade
	{
		
		public function ApplicationFacade()
		{
			super();
		}
		
		public static const STARTUP:String = "startup";
		public static const ERROR_LOAD_FILE:String = "Le fichier ne peut pas être chargé";
		public static const VIEW_LOGIN:String = "viewLogin";
		public static const VIEW_MENU:String = "viewMenu";
		public static const VIEW_EVENEMENT:String = "viewEvenement";
		public static const VIEW_QRCODE:String = "viewQRCode";
		public static const VIEW_INFOSQRCODE:String = "viewInfosQRCode";
		public static const VIEW_CHOICE:String = "viewChoice";
		public static const LOADING_MENU_COMPLETE:String = "loadingMenuComplete";
		public static const LOADING_EVENEMENT_COMPLETE:String = "loadingEvenementComplete";
		public static const LOADING_QRCODE_COMPLETE:String = "loadingQRCodeComplete";
		public static const LOADING_INFOSQRCODE_COMPLETE:String = "loadingInfosQRCodeComplete";
		public static const LOADING_CHOICE_COMPLETE:String = "loadingChoiceComplete";
		public static const COMMAND_LOAD_MENU:String = "LoadMenuCommand";		
		public static const COMMAND_LOAD_EVENEMENT:String = "LoadEvenementCommand";		
		public static const COMMAND_LOAD_QRCODE:String = "LoadQRCodeCommand";		
		public static const COMMAND_LOAD_INFOSQRCODE:String = "LoadInfosQRCodeCommand";		
		public static const COMMAND_LOAD_CHOICE:String = "LoadChoiceCommand";		
		
		
		public function startup(app:EpiVisiteBureautique):void
		{
			sendNotification(STARTUP, app);
		}
		
		public static function getInstance():ApplicationFacade
		{
			if (instance == null)
				instance = new ApplicationFacade();
			return instance as ApplicationFacade;
		}
		
		override protected function initializeController():void
		{
			super.initializeController();
			registerCommand(STARTUP, ApplicationStartupCommand);
			registerCommand(COMMAND_LOAD_MENU, LoadMenuCommand);
			registerCommand(COMMAND_LOAD_EVENEMENT, LoadEvenementCommand);
			registerCommand(COMMAND_LOAD_QRCODE, LoadQRCodeCommand);
			registerCommand(COMMAND_LOAD_INFOSQRCODE, LoadInfosQRCodeCommand);
			registerCommand(COMMAND_LOAD_CHOICE, LoadChoiceCommand);
		}
	}
}